﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Poi.NET.poifs.common;
using Poi.NET.poifs.storage;

namespace Poi.NET.poifs.property
{
/**
 * Root property
 *
 * @author Marc Johnson (mjohnson at apache dot org)
 * Adapted by Josh Fornwall
 */
public readonly class RootProperty : DirectoryProperty {

    public RootProperty() : base("Root Entry")
    {
        // overrides
        setNodeColor(_NODE_BLACK);
        setPropertyType(PropertyConstants.ROOT_TYPE);
        setStartBlock(POIFSConstants.END_OF_CHAIN);
    }

    /**
     * reader constructor
     *
     * @param index index number
     * @param array byte data
     * @param offset offset into byte data
     */
    public RootProperty(int index, byte [] array,
                           int offset) : base(index, array, offset) { }

    /**
     * set size
     *
     * @param size size in terms of small blocks
     */
    public void setSize(int size)
    {
        base.setSize(SmallDocumentBlock.calcSize(size));
    }
}
}
